package co.edu.unal.franquicias.visa.representations;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;

import co.edu.unal.franquicias.visa.domain.HeaderFile;

@XmlRootElement(name = "headerFile")
public class HeaderFileRepresentation extends Representation {
	
	@XmlElement(name = "brandId")
    private String brandId;
	
	@XmlElement(name = "establishmentId")
	private String establishmentId;
	
	public HeaderFileRepresentation() {
		// TODO Auto-generated constructor stub
	}
	
	public HeaderFileRepresentation(HeaderFile headerFile, Link...links) {
		this.brandId = headerFile.getBrandId();
		this.establishmentId = headerFile.getEstablishmentId();
		this.links = java.util.Arrays.asList(links);
	}
	
	public static HeaderFileRepresentation createResponseHeaderFileRepresentation(HeaderFile headerFile, RestUri restUri) {
		return new HeaderFileRepresentation(headerFile, new Link(Representation.SELF_REL_VALUE, restUri));
	}
	
	public HeaderFile getHeaderFile() {
		HeaderFile headerFile = new HeaderFile();
		headerFile.setBrandId(brandId);
		headerFile.setEstablishmentId(establishmentId);
		return headerFile;
	}
	
}
